﻿@using BonjourQuotation.UI.Models.SetupModel
@model SetupManageQuotationGroupsGridViewModel

@using (@Html.BeginForm("SaveManageQuotationGroupDetailData", "Setup", FormMethod.Post, new { id = "LoadManageQuotationGroupDetailsForm" }))
{
     <div id="ErrorMessagesDivPopUp" style="margin:auto;width:960px; height: 30px; ">
        <label for="Validation" id="errorMessageClient" class="errorMessage"></label>
        @if (Model.Message != null)
        {
            @Html.LabelForModel(Model.Message, new { @class = "errorMessage", id = "errorMessageServer" })
        }
    </div>

    <div style="width: 681px; min-height: 300px; max-height: 442px; margin: auto; padding-bottom: 30px; ">
        <table class="table table-bordered table-hover table-condensed" style="margin-bottom: -1px !important; width: 660px;background-color:white;">
            <thead>
                <tr>
                    <th width="15%;" class="GridHeaders">Quota ID</th>
                    <th width="25%;" class="GridHeaders">Code</th>
                    <th width="35%;" class="GridHeaders">Name</th>
                    <th width="25%;" class="GridHeaders">Status</th>
                </tr>
            </thead>
        </table>
        <div style="height:350px; overflow-y:auto;">
            <table class="table table-bordered table-hover table-condensed" style="width: 660px; table-layout: fixed; background-color: white;">
                <tbody>
                    @for (int ind = 0; ind < Model.Rows.Count; ind++)
                    {
                        @Html.HiddenFor(model => model.Rows[ind].GroupID)
                        Model.SelectedStatusID = Model.Rows[ind].SelStatusID;
                        <tr>
                            <td width="15%;">@Html.LabelForModel(Model.Rows[ind].QuotaID, new { @class = "table_inputs_90", @style = "text-align: left" })</td>
                            <td width="25%;">@Html.LabelForModel(Model.Rows[ind].GroupCode, new { @class = "table_inputs_160", @style = "text-align: left" })</td>
                            
                            @if (Model.MenuManageQuotationGroupsEdit)
                            { 
                                <td width="35%;">@Html.TextBoxFor(model => Model.Rows[ind].GroupName, new { @class = "table_inputs_225 table_inputs_WithoutBox ChangedManageQuotationGroupsElements", @style = "text-align: left" })</td>
                                <td width="25%;" style="text-align:left">
                                    @Html.DropDownListFor(model => Model.SelectedStatusID, new SelectList(Model.StatusID, "Value", "Text"), new { @class = "table_inputs_162 table_inputs_WithoutBox ChangedManageQuotationGroupsElements QuotaGroupStatusDrop" })
                                    @Html.DropDownListFor(model => Model.Rows[ind].SelStatusID, new SelectList(Model.StatusID, "Value", "Text"), new { @class = "RoomGridDropHide" })
                                </td>
                            }
                            else
                            {
                                 <td width="35%;">@Html.TextBoxFor(model => Model.Rows[ind].GroupName, new { @class = "table_inputs_225 table_inputs_WithoutBox", @style = "text-align: left", @disabled = "disabled" })</td>
                                 <td width="25%;" style="overflow: hidden">
                                    @Html.DropDownListFor(model => Model.SelectedStatusID, new SelectList(Model.StatusID, "Value", "Text"), new { @class = "table_inputs_190 table_inputs_WithoutBox DisabledDropDown", @disabled = "disabled", @style = "font-weight:bold" })
                                    @Html.DropDownListFor(model => Model.Rows[ind].SelStatusID, new SelectList(Model.StatusID, "Value", "Text"), new { @class = "RoomGridDropHide" })
                                </td>
                            }
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
}
<div style="float: right; height: 25px; width: 140px; margin-right: 95px; ">
    <button class="btn14 btn60" style="float: left;@(@Model.IsCanView ? "" : "Display:none ")" type="button" id="ManageQuotationGroupMoreBtn">More</button>
    @if (Model.MenuManageQuotationGroupsEdit)
    {
        <button class="btn14 btn50" style="float: right;" type="button" id="ManageQuotationGroupDetailsSaveBtn">Save</button>
    }
    else
    {
        <button class="btn14 btn50" style="float: right;" type="button" disabled="disabled" id="ManageQuotationGroupDetailsSaveBtn">Save</button>
    }
</div>
